New function gdk_pixmap_foreign_new(). (gtk-blizzard-981005-0. Christopher
authorOwen Taylor <otaylor@redhat.com>
Fri, 13 Nov 1998 21:28:36 +0000 (21:28 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 13 Nov 1998 21:28:36 +0000 (21:28 +0000)
Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>

* gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
(gtk-blizzard-981005-0.
 Christopher Blizzard <blizzard@applied-theory.com)

* gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
gdk_pixmap_foreign_new to gdkx.h.

Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>

* gtk/Makefile.am: Added rules to generate an empty
GTK+ theme called "Default" upon installation.

* gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
of fonts and fontsets.
(gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)

* gtk/gtkmain.c: Change test to detect glibc's
utf8 based mb* functions to be more specific.

* gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation
cleanups.

18 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdk.h
gdk/gdkpixmap.c
gdk/gdktypes.h
gdk/gdkx.h
gdk/x11/gdkpixmap-x11.c
gdk/x11/gdkx.h
gtk/Makefile.am
gtk/gtkmain.c
gtk/gtkrc.c
gtk/testgtkrc
tests/testgtkrc

index e918ae30e0a80b18be8d2b240697bffb04dcbe89..4e6e0e9b7b9b227597010ed8a5bcf954f0dcae53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
+       (gtk-blizzard-981005-0. 
+        Christopher Blizzard <blizzard@applied-theory.com)
+
+       * gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
+       gdk_pixmap_foreign_new to gdkx.h.
+
+Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am: Added rules to generate an empty
+       GTK+ theme called "Default" upon installation.
+       
+       * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
+       of fonts and fontsets. 
+       (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)
+
+       * gtk/gtkmain.c: Change test to detect glibc's
+       utf8 based mb* functions to be more specific.
+
+       * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation 
+       cleanups.
+
 Fri Nov 13 16:43:36 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't
index e918ae30e0a80b18be8d2b240697bffb04dcbe89..4e6e0e9b7b9b227597010ed8a5bcf954f0dcae53 100644 (file)
@@ -1,3 +1,27 @@
+Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
+       (gtk-blizzard-981005-0. 
+        Christopher Blizzard <blizzard@applied-theory.com)
+
+       * gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
+       gdk_pixmap_foreign_new to gdkx.h.
+
+Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am: Added rules to generate an empty
+       GTK+ theme called "Default" upon installation.
+       
+       * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
+       of fonts and fontsets. 
+       (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)
+
+       * gtk/gtkmain.c: Change test to detect glibc's
+       utf8 based mb* functions to be more specific.
+
+       * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation 
+       cleanups.
+
 Fri Nov 13 16:43:36 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't
index e918ae30e0a80b18be8d2b240697bffb04dcbe89..4e6e0e9b7b9b227597010ed8a5bcf954f0dcae53 100644 (file)
@@ -1,3 +1,27 @@
+Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
+       (gtk-blizzard-981005-0. 
+        Christopher Blizzard <blizzard@applied-theory.com)
+
+       * gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
+       gdk_pixmap_foreign_new to gdkx.h.
+
+Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am: Added rules to generate an empty
+       GTK+ theme called "Default" upon installation.
+       
+       * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
+       of fonts and fontsets. 
+       (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)
+
+       * gtk/gtkmain.c: Change test to detect glibc's
+       utf8 based mb* functions to be more specific.
+
+       * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation 
+       cleanups.
+
 Fri Nov 13 16:43:36 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't
index e918ae30e0a80b18be8d2b240697bffb04dcbe89..4e6e0e9b7b9b227597010ed8a5bcf954f0dcae53 100644 (file)
@@ -1,3 +1,27 @@
+Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
+       (gtk-blizzard-981005-0. 
+        Christopher Blizzard <blizzard@applied-theory.com)
+
+       * gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
+       gdk_pixmap_foreign_new to gdkx.h.
+
+Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am: Added rules to generate an empty
+       GTK+ theme called "Default" upon installation.
+       
+       * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
+       of fonts and fontsets. 
+       (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)
+
+       * gtk/gtkmain.c: Change test to detect glibc's
+       utf8 based mb* functions to be more specific.
+
+       * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation 
+       cleanups.
+
 Fri Nov 13 16:43:36 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't
index e918ae30e0a80b18be8d2b240697bffb04dcbe89..4e6e0e9b7b9b227597010ed8a5bcf954f0dcae53 100644 (file)
@@ -1,3 +1,27 @@
+Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
+       (gtk-blizzard-981005-0. 
+        Christopher Blizzard <blizzard@applied-theory.com)
+
+       * gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
+       gdk_pixmap_foreign_new to gdkx.h.
+
+Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am: Added rules to generate an empty
+       GTK+ theme called "Default" upon installation.
+       
+       * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
+       of fonts and fontsets. 
+       (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)
+
+       * gtk/gtkmain.c: Change test to detect glibc's
+       utf8 based mb* functions to be more specific.
+
+       * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation 
+       cleanups.
+
 Fri Nov 13 16:43:36 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't
index e918ae30e0a80b18be8d2b240697bffb04dcbe89..4e6e0e9b7b9b227597010ed8a5bcf954f0dcae53 100644 (file)
@@ -1,3 +1,27 @@
+Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
+       (gtk-blizzard-981005-0. 
+        Christopher Blizzard <blizzard@applied-theory.com)
+
+       * gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
+       gdk_pixmap_foreign_new to gdkx.h.
+
+Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am: Added rules to generate an empty
+       GTK+ theme called "Default" upon installation.
+       
+       * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
+       of fonts and fontsets. 
+       (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)
+
+       * gtk/gtkmain.c: Change test to detect glibc's
+       utf8 based mb* functions to be more specific.
+
+       * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation 
+       cleanups.
+
 Fri Nov 13 16:43:36 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't
index e918ae30e0a80b18be8d2b240697bffb04dcbe89..4e6e0e9b7b9b227597010ed8a5bcf954f0dcae53 100644 (file)
@@ -1,3 +1,27 @@
+Fri Nov 13 11:22:38 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new().
+       (gtk-blizzard-981005-0. 
+        Christopher Blizzard <blizzard@applied-theory.com)
+
+       * gdk/gdk.h gdk/gdkx.h: Moved gdk_window_foreign_new and
+       gdk_pixmap_foreign_new to gdkx.h.
+
+Fri Nov 13 16:06:48 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am: Added rules to generate an empty
+       GTK+ theme called "Default" upon installation.
+       
+       * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance
+       of fonts and fontsets. 
+       (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp)
+
+       * gtk/gtkmain.c: Change test to detect glibc's
+       utf8 based mb* functions to be more specific.
+
+       * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation 
+       cleanups.
+
 Fri Nov 13 16:43:36 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't
index 5ee53061b57c4c631586b9180cad0b2e8010b376..84563cf8fe4ae103edaeccb6e872798eb7756efb 100644 (file)
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -126,7 +126,6 @@ GdkWindow*    gdk_window_new             (GdkWindow     *parent,
                                      GdkWindowAttr *attributes,
                                      gint           attributes_mask);
 
-GdkWindow*    gdk_window_foreign_new (guint32       anid);
 void         gdk_window_destroy     (GdkWindow     *window);
 GdkWindow*    gdk_window_ref        (GdkWindow     *window);
 void         gdk_window_unref       (GdkWindow     *window);
index dfaf4822c94c35b70d00e504c54a98849036c180..291c8d7746ba0e2f7a54f986c74e520d71bf5eb4 100644 (file)
@@ -748,6 +748,53 @@ gdk_pixmap_create_from_xpm_d (GdkWindow  *window,
                                                transparent_color, data);
 }
 
+GdkPixmap*
+gdk_pixmap_foreign_new (guint32 anid)
+{
+  GdkPixmap *pixmap;
+  GdkWindowPrivate *window_private;
+  GdkWindowPrivate *private;
+  Pixmap xpixmap;
+  Window root_return;
+  unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret;
+
+  /* check to make sure we were passed something at
+     least a little sane */
+  g_return_val_if_fail((anid != 0), NULL);
+  
+  /* set the pixmap to the passed in value */
+  xpixmap = anid;
+  /* get the root window */
+  window_private = &gdk_root_parent;
+
+  /* get information about the Pixmap to fill in the structure for
+     the gdk window */
+  if (!XGetGeometry(window_private->xdisplay, xpixmap, &root_return,
+                   &x_ret, &y_ret, &w_ret, &h_ret, &bw_ret, &depth_ret))
+      return NULL;
+      
+  /* allocate a new gdk pixmap */
+  private = g_new(GdkWindowPrivate, 1);
+  pixmap = (GdkPixmap *)private;
+
+  private->xdisplay = window_private->xdisplay;
+  private->window_type = GDK_WINDOW_PIXMAP;
+  private->xwindow = xpixmap;
+  private->colormap = NULL;
+  private->parent = NULL;
+  private->x = 0;
+  private->y = 0;
+  private->width = w_ret;
+  private->height = h_ret;
+  private->resize_count = 0;
+  private->ref_count = 1;
+  private->destroyed = 0;
+  
+  gdk_xid_table_insert(&private->xwindow, pixmap);
+
+  return pixmap;
+}
+
 GdkPixmap*
 gdk_pixmap_ref (GdkPixmap *pixmap)
 {
index 964095b4c7fe7c2a861684debb4201e3fda2e2aa..26527b45f8105609eb58e42b174427f8f07c3015 100644 (file)
@@ -847,6 +847,7 @@ struct _GdkCursor
   GdkCursorType type;
 };
 
+
 struct _GdkColorContextDither
 {
   gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
index fbe655d2eaa14d34deacbf1b90ebee171122bec0..306f03d091567e797632f972a83798d03ec85bab 100644 (file)
@@ -47,5 +47,8 @@ GdkColormap* gdkx_colormap_get (Colormap xcolormap);
 Window        gdk_get_client_window      (Display  *dpy,
                                           Window    win);
 
+/* Functions to create pixmaps and windows from their X equivalents */
+GdkPixmap    *gdk_pixmap_foreign_new (guint32     anid);
+GdkWindow    *gdk_window_foreign_new (guint32       anid);
 
 #endif /* __GDK_X_H__ */
index dfaf4822c94c35b70d00e504c54a98849036c180..291c8d7746ba0e2f7a54f986c74e520d71bf5eb4 100644 (file)
@@ -748,6 +748,53 @@ gdk_pixmap_create_from_xpm_d (GdkWindow  *window,
                                                transparent_color, data);
 }
 
+GdkPixmap*
+gdk_pixmap_foreign_new (guint32 anid)
+{
+  GdkPixmap *pixmap;
+  GdkWindowPrivate *window_private;
+  GdkWindowPrivate *private;
+  Pixmap xpixmap;
+  Window root_return;
+  unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret;
+
+  /* check to make sure we were passed something at
+     least a little sane */
+  g_return_val_if_fail((anid != 0), NULL);
+  
+  /* set the pixmap to the passed in value */
+  xpixmap = anid;
+  /* get the root window */
+  window_private = &gdk_root_parent;
+
+  /* get information about the Pixmap to fill in the structure for
+     the gdk window */
+  if (!XGetGeometry(window_private->xdisplay, xpixmap, &root_return,
+                   &x_ret, &y_ret, &w_ret, &h_ret, &bw_ret, &depth_ret))
+      return NULL;
+      
+  /* allocate a new gdk pixmap */
+  private = g_new(GdkWindowPrivate, 1);
+  pixmap = (GdkPixmap *)private;
+
+  private->xdisplay = window_private->xdisplay;
+  private->window_type = GDK_WINDOW_PIXMAP;
+  private->xwindow = xpixmap;
+  private->colormap = NULL;
+  private->parent = NULL;
+  private->x = 0;
+  private->y = 0;
+  private->width = w_ret;
+  private->height = h_ret;
+  private->resize_count = 0;
+  private->ref_count = 1;
+  private->destroyed = 0;
+  
+  gdk_xid_table_insert(&private->xwindow, pixmap);
+
+  return pixmap;
+}
+
 GdkPixmap*
 gdk_pixmap_ref (GdkPixmap *pixmap)
 {
index fbe655d2eaa14d34deacbf1b90ebee171122bec0..306f03d091567e797632f972a83798d03ec85bab 100644 (file)
@@ -47,5 +47,8 @@ GdkColormap* gdkx_colormap_get (Colormap xcolormap);
 Window        gdk_get_client_window      (Display  *dpy,
                                           Window    win);
 
+/* Functions to create pixmaps and windows from their X equivalents */
+GdkPixmap    *gdk_pixmap_foreign_new (guint32     anid);
+GdkWindow    *gdk_window_foreign_new (guint32       anid);
 
 #endif /* __GDK_X_H__ */
index d2802d55ec9298ca48fbe75c1b5e0e89f0b44ff8..ddada2835f9fbf8e2f99ebfb760a935260828f14 100644 (file)
@@ -284,6 +284,16 @@ gtkmarshal.c gtkmarshal.h: @REBUILD@ gtkmarshal.list genmarshal.pl
 libgtk_la_LDFLAGS = \
        -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE)
 
+# We create a dummy theme for the default GTK+ theme
+
+install-data-local:
+       $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk
+       echo "# Empty gtkrc for default theme" > \
+           $(DESTDIR)$(datadir)/themes/Default/gtk/gtkrc
+
+uninstall-local:
+       rm -f $(DESTDIR)$(datadir)/themes/Default/gtkrc
+
 EXTRA_DIST = \
        line-arrow.xbm          \
        line-wrap.xbm           \
index e362c5874c5e90c8dfa3d1852abdd47ea0bdea67..f78d2beefcbcca193fde40327e0b48f7caae3f1d 100644 (file)
@@ -401,22 +401,33 @@ gtk_init (int      *argc,
    * correctly - set if either mblen("\xc0", MB_CUR_MAX) == 1 in the
    * C locale, or we're using X's mb functions. (-DX_LOCALE && locale != C)
    */
-
-  current_locale = g_strdup (setlocale (LC_CTYPE, NULL));
+  current_locale = setlocale (LC_CTYPE, NULL);
 
 #ifdef X_LOCALE
   if ((strcmp (current_locale, "C")) && (strcmp (current_locale, "POSIX")))
     gtk_use_mb = TRUE;
   else
-#endif
+#endif /* X_LOCALE */
     {
-      setlocale (LC_CTYPE, "C");
-      gtk_use_mb = (mblen ("\xc0", MB_CUR_MAX) == 1);
-      setlocale (LC_CTYPE, current_locale);
+      /* Detect GNU libc, where mb == UTF8. Not useful unless it's
+       * really a UTF8 locale. The below still probably will
+       * screw up on Greek, Cyrillic, etc, encoded as UTF8.
+       */
+      
+      wchar_t result;
+      gtk_use_mb = TRUE;
+      
+      if ((MB_CUR_MAX == 2) &&
+         (mbstowcs (&result, "\xdd\xa5", 1) > 0) &&
+         result == 0x765)
+       {
+         if ((strlen (current_locale) < 4) ||
+             g_strcasecmp (current_locale + strlen(current_locale) - 4, "utf8"))
+           gtk_use_mb = FALSE;
+       }
     }
 
-  g_free (current_locale);
-
   GTK_NOTE (MISC,
            g_message ("%s multi-byte string functions.", 
                       gtk_use_mb ? "Using" : "Not using"));
index fb006fb2421b10abfce28aa8be1571f4af6019e0..59dc6f4817892a115fdc4f978dd98ae26e8bec08 100644 (file)
@@ -1117,14 +1117,16 @@ gtk_rc_parse_style (GScanner *scanner)
              rc_style->base[i] = parent_style->base[i];
            }
          
-         if (rc_style->fontset_name)
+         if (parent_style->fontset_name)
            {
-             g_free (rc_style->fontset_name);
+             if (rc_style->fontset_name)
+               g_free (rc_style->fontset_name);
              rc_style->fontset_name = g_strdup (parent_style->fontset_name);
            }
-         else if (rc_style->font_name)
+         else if (parent_style->font_name)
            {
-             g_free (rc_style->font_name);
+             if (rc_style->font_name)
+               g_free (rc_style->font_name);
              rc_style->font_name = g_strdup (parent_style->font_name);
            }
          
index 36bb12464292137e1742d8b7e4bdb4328b9f3a36..da81deb22d6fc90ef9737098f0b0d2b41de9695a 100644 (file)
 # widget <widget_set> style <style_name>
 # widget_class <widget_class_set> style <style_name>
 
-include "/opt/themes/share/themes/Metal/gtk/gtkrc"
+#include "/opt/themes/share/themes/W/gtk/gtkrc"
 #include "/home/otaylor/.themes/Ignorant/gtk/gtkrc"
 
 style "defaultfont" {
-#  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
+  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
 #  fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
 }
 
index 36bb12464292137e1742d8b7e4bdb4328b9f3a36..da81deb22d6fc90ef9737098f0b0d2b41de9695a 100644 (file)
 # widget <widget_set> style <style_name>
 # widget_class <widget_class_set> style <style_name>
 
-include "/opt/themes/share/themes/Metal/gtk/gtkrc"
+#include "/opt/themes/share/themes/W/gtk/gtkrc"
 #include "/home/otaylor/.themes/Ignorant/gtk/gtkrc"
 
 style "defaultfont" {
-#  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
+  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
 #  fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
 }